package com.demo.aesRsa.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.demo.aesRsa.domain.UserDO;
import com.demo.aesRsa.mapper.UserMapper;
import com.demo.aesRsa.service.UserService;
import com.demo.aesRsa.vo.UserVO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;


/**
 * @author lkz
 * @version 1.0.0
 * @ClassName UserServiceImpl.java
 * @Description
 * @createTime 2022年09月06日 10:39:00
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements UserService {

    private final UserMapper userMapper;

    public UserServiceImpl(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public UserVO getUser(String username, String password) {
        UserVO userVO = new UserVO();
        UserDO userDO = userMapper.getUser(username, password);
        BeanUtils.copyProperties(userDO, userVO);
        List<String> list = new ArrayList<>();
        list.add("中文1");
        list.add("张三2");
        list.add("李四3");
        list.add("中文");
        userVO.setVolist(list);
        return userVO;
    }
}
